// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Serverless.Fluent;
using Elastic.Clients.Elasticsearch.Serverless.Requests;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport;
using Elastic.Transport.Extensions;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot;

public sealed partial class SnapshotStatusRequestParameters : RequestParameters
{
	/// <summary>
	/// <para>
	/// Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown
	/// </para>
	/// </summary>
	public bool? IgnoreUnavailable { get => Q<bool?>("ignore_unavailable"); set => Q("ignore_unavailable", value); }

	/// <summary>
	/// <para>
	/// Explicit operation timeout for connection to master node
	/// </para>
	/// </summary>
	public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q<Elastic.Clients.Elasticsearch.Serverless.Duration?>("master_timeout"); set => Q("master_timeout", value); }
}

/// <summary>
/// <para>
/// Returns information about the status of a snapshot.
/// </para>
/// </summary>
public sealed partial class SnapshotStatusRequest : PlainRequest<SnapshotStatusRequestParameters>
{
	public SnapshotStatusRequest()
	{
	}

	public SnapshotStatusRequest(Elastic.Clients.Elasticsearch.Serverless.Name? repository) : base(r => r.Optional("repository", repository))
	{
	}

	public SnapshotStatusRequest(Elastic.Clients.Elasticsearch.Serverless.Name? repository, Elastic.Clients.Elasticsearch.Serverless.Names? snapshot) : base(r => r.Optional("repository", repository).Optional("snapshot", snapshot))
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotStatus;

	protected override HttpMethod StaticHttpMethod => HttpMethod.GET;

	internal override bool SupportsBody => false;

	internal override string OperationName => "snapshot.status";

	/// <summary>
	/// <para>
	/// Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown
	/// </para>
	/// </summary>
	[JsonIgnore]
	public bool? IgnoreUnavailable { get => Q<bool?>("ignore_unavailable"); set => Q("ignore_unavailable", value); }

	/// <summary>
	/// <para>
	/// Explicit operation timeout for connection to master node
	/// </para>
	/// </summary>
	[JsonIgnore]
	public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q<Elastic.Clients.Elasticsearch.Serverless.Duration?>("master_timeout"); set => Q("master_timeout", value); }
}

/// <summary>
/// <para>
/// Returns information about the status of a snapshot.
/// </para>
/// </summary>
public sealed partial class SnapshotStatusRequestDescriptor : RequestDescriptor<SnapshotStatusRequestDescriptor, SnapshotStatusRequestParameters>
{
	internal SnapshotStatusRequestDescriptor(Action<SnapshotStatusRequestDescriptor> configure) => configure.Invoke(this);

	public SnapshotStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name? repository, Elastic.Clients.Elasticsearch.Serverless.Names? snapshot) : base(r => r.Optional("repository", repository).Optional("snapshot", snapshot))
	{
	}

	public SnapshotStatusRequestDescriptor()
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotStatus;

	protected override HttpMethod StaticHttpMethod => HttpMethod.GET;

	internal override bool SupportsBody => false;

	internal override string OperationName => "snapshot.status";

	public SnapshotStatusRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable);
	public SnapshotStatusRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout);

	public SnapshotStatusRequestDescriptor Repository(Elastic.Clients.Elasticsearch.Serverless.Name? repository)
	{
		RouteValues.Optional("repository", repository);
		return Self;
	}

	public SnapshotStatusRequestDescriptor Snapshot(Elastic.Clients.Elasticsearch.Serverless.Names? snapshot)
	{
		RouteValues.Optional("snapshot", snapshot);
		return Self;
	}

	protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
	{
	}
}